package com.chuyu.jzwboa.adapter.message;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.chuyu.jzwboa.R;

import java.util.List;

/**
 * @author 杨仕俊
 * @description 消息  通知fragment adapter
 * Created by wo on 2017/12/15.
 */

public class NotiyAdater extends BaseAdapter {
    private  Context context;
    private  List<String> list;


    public NotiyAdater(Context context, List<String> liststr) {
        this.context=context;
        this.list=liststr;
    }

    @Override
    public int getCount() {
        return list==null?0:list.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
         ViewHolder holder;
        if (view==null){
            holder = new ViewHolder();
            view=View.inflate(context, R.layout.item_notiify,null);
            holder.time=view.findViewById(R.id.text_notity_time);
            holder.titel=view.findViewById(R.id.text_notity_title);
            holder.type=view.findViewById(R.id.text_notity_type);
            view.setTag(holder);
        }else {
            holder= (ViewHolder) view.getTag();
        }

        return view;
    }

    class ViewHolder{
        TextView titel;
        TextView time;
        TextView type;
    }
}
